package com.videri.match.client;

import com.allen_sauer.gwt.dragdrop.client.DragController;
import com.allen_sauer.gwt.dragdrop.client.DragEndEvent;
import com.google.gwt.user.client.ui.SimplePanel;
import com.google.gwt.user.client.ui.VerticalPanel;
import com.google.gwt.user.client.ui.Widget;
import com.allen_sauer.gwt.dragdrop.client.drop.SimpleDropController;

public class SourceListDropController extends SimpleDropController{
	private final VerticalPanel myDropTarget;
	
	public SourceListDropController(VerticalPanel dropTarget)
	{
		super(dropTarget);
		this.myDropTarget = dropTarget;
	}

	public DragEndEvent onDrop(Widget reference, Widget draggable, DragController dragController) {
		DragEndEvent dee = super.onDrop(reference, draggable, dragController);
		myDropTarget.add(draggable);
		return dee;
	}
	
	public void addWidget(Widget widget) {
		myDropTarget.add(widget);
	}
}
